package com.jy.menu.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jy.menu.entity.MenuEntity;
import com.jy.menu.service.MenuService;

@Controller
@RequestMapping(value = "/menu")
public class MenuController {
	
	@Autowired
	private MenuService menuService;
	
	@RequestMapping(value = "/findAll", method = RequestMethod.GET)
	@ResponseBody
	public List<MenuEntity> findAll(HttpServletRequest request,HttpServletResponse response, ModelMap modelMap) throws IOException {
		List<MenuEntity> data = menuService.findAll();
		return data;
	}
}
